﻿namespace PhoneApp._0923;

public class Demo
{
    private String name;

    public void TestPrint()
    {
        //给定一个三位数，求各个位数字
        Console.WriteLine("请输入一个三位数：");
        int num = Convert.ToInt32(Console.ReadLine());
        // int num = 123;
        Console.WriteLine(num/100);
        
        Console.WriteLine(num%100/10);
        
        Console.WriteLine(num%10);
    }

    public void TestPrint2()
    {
        //判断闰年
        //1、能被4整除，并且不能被100整除
        //2、能被400整除

        Console.WriteLine("请输入年份：");
        int num =Convert.ToInt32(Console.ReadLine());
        bool flag = (num % 4 == 0  && num % 100 != 0) || num % 400 == 0;
        if (flag == false)
        {
            Console.WriteLine(num+"不是闰年");
        }
        else
        {
            Console.WriteLine(num+"是闰年");
        }
            
    }

    public void TestPrint3()
    {
        
    }
}